#include "RemoteServer.h"
#include <iostream>


cat::RemoteServer::RemoteServer(void)
{
}


cat::RemoteServer::~RemoteServer(void)
{
}

void cat::RemoteServer::think(void)
{
	char data[100];
	std::size_t received;

	if(socket.receive(data, 100, received) == sf::Socket::Done)
		return data; //TODO --> transform char[100] to string
}

void cat::RemoteServer::connect(std::string adress, int port)
{
	_socket.setBlocking(true);
	sf::Socket::Status status = _socket.connect(adress, port);
	if (status != sf::Socket::Done)
	{
		std::cerr<<"Unable to connect to the server"<<std::endl;
	}

	std::cout << "Connected to the server succesfully" <<std::endl;
}

void cat::RemoteServer::disconnect(void)
{
	
}